package com.ad2campaign.engine.core.tasklet;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

import com.ad2campaign.engine.core.TaskStatus;
import com.ad2campaign.engine.db.dao.PushNotificationMasterDao;

public class SuccessUpdateTasklet implements Tasklet {
 	private Integer pushNotficationMasterId;
	private PushNotificationMasterDao pushNotificationMasterDao;


	public Integer getPushNotficationMasterId() {
		return pushNotficationMasterId;
	}


	public void setPushNotficationMasterId(Integer pushNotficationMasterId) {
		this.pushNotficationMasterId = pushNotficationMasterId;
	}


	public PushNotificationMasterDao getPushNotificationMasterDao() {
		return pushNotificationMasterDao;
	}


	public void setPushNotificationMasterDao(
			PushNotificationMasterDao pushNotificationMasterDao) {
		this.pushNotificationMasterDao = pushNotificationMasterDao;
	}


	@Override
	public RepeatStatus execute(StepContribution contribution,	ChunkContext chunkContext) throws Exception 
	{
		pushNotificationMasterDao.updateMessageStatusId(pushNotficationMasterId, TaskStatus.COMPLETED);
		
		return RepeatStatus.FINISHED;
	}

}
